import java.util.Scanner;
public class ICSfile {
	public static void main(String[]args){
	Scanner scan = new Scanner(System.in);
	
	System.out.println("New event or Recurring event?");
	String event = scan.nextLine(); 
	if (event.equals("new event")){
		System.out.println("Name of the event?");
		String summary = scan.nextLine();
		System.out.println("Class?");
		String cls = scan.nextLine();
		System.out.println("Location?");
		String location = scan.nextLine();
		System.out.println("Any comment?");
		String comm = scan.nextLine();
		System.out.println("What things do you need?");
		String resources = scan.nextLine(); 
		System.out.println("What year?");
		int year = scan.nextInt();
		System.out.println("What month?");
		int mon = scan.nextInt();
		System.out.println("What day?");
		int day = scan.nextInt();
		System.out.println("What hour?");
		int hour = scan.nextInt();
		System.out.println("What min?");
		int min = scan.nextInt();
		System.out.println("Unitl what year?");
		int eyear = scan.nextInt();
		System.out.println("unitl What month?");
		int emon = scan.nextInt();
		System.out.println("until What day?");
		int eday = scan.nextInt();
		System.out.println("until What hour?");
		int ehour = scan.nextInt();
		System.out.println("until What min?");
		int emin = scan.nextInt();
		
		String ics = "";
		ics = "BEGIN:VCALENDAR"+ "/n" +
				"VERSION:2.0" + "/n" + 
				"BEGIN:VEVENT" + "/n" +
				"CLASS:" + cls + "/n" +
				"SUMMARY:" + summary + "/n" +
				"COMMENT:" + comm + "/n" +
				"LOCATION:" + location + "/n" +
				"RESOURCES:" + resources + "/n" +
				"DTSTART:" + year + mon + day + "T" + hour + min + "00" + "Z" + "/n" + 
				"DTEND:" + eyear + emon + eday + "T" + ehour + emin + "00" + "Z" + "/n" +
				"TZID:HAWAII" + "/n" +
				"END:VEVENT"  + "/n" + 
				"END:VCALENDAR"; 
		System.out.println(ics);
							
	}else {
		System.out.println("What frequency?");
		String freq = scan.nextLine(); 
		System.out.println("Name of the event?");
		String rsummary = scan.nextLine();
		System.out.println("Class?");
		String rcls = scan.nextLine();
		System.out.println("Location?");
		String rlocation = scan.nextLine();
		System.out.println("Any comment?");
		String rcomm = scan.nextLine();
		System.out.println("What things do you need?");
		String rresources = scan.nextLine(); 
		System.out.println("What year?");
		int ryear = scan.nextInt();
		System.out.println("What month?");
		int rmon = scan.nextInt();
		System.out.println("What day?");
		int rday = scan.nextInt();
		System.out.println("What hour?");
		int rhour = scan.nextInt();
		System.out.println("What min?");
		int rmin = scan.nextInt();
		System.out.println("Unitl what year?");
		int reyear = scan.nextInt();
		System.out.println("unitl What month?");
		int remon = scan.nextInt();
		System.out.println("until What day?");
		int reday = scan.nextInt();
		System.out.println("until What hour?");
		int rehour = scan.nextInt();
		System.out.println("until What min?");
		int remin = scan.nextInt();
		
		String rics = "";
		rics = "BEGIN:VCALENDAR"+ "/n" +
				"VERSION:2.0" + "/n" + 
				"BEGIN:VEVENT" + "/n" +
				"CLASS:" + rcls + "/n" +
				"SUMMARY:" + rsummary + "/n" +
				"COMMENT:" + rcomm + "/n" +
				"LOCATION:" + rlocation + "/n" +
				"RESOURCES:" + rresources + "/n" +
				"DTSTART:" + ryear + rmon + rday + "T" + rhour + rmin + "00" + "Z" + "/n" + 
				"DTEND:" + reyear + remon + reday + "T" + rehour + remin + "00" + "Z" + "/n" +
				"TZID:HAWAII" + "/n" +
				"RRULE:FREQ=" + freq + "/n" +
				"END:VEVENT"  + "/n" + 
				"END:VCALENDAR"; 
		System.out.println(rics);
	}
	
	}
}
